# coding:utf-8
from odoo import models, fields, api, _


class AccountSubmit(models.Model):
    _inherit = 'account.invoice'
    _name = 'account.invoice'

    is_submit = fields.Boolean('Is Submit', default=False)

class AccountSubmit(models.Model):
    _inherit = 'account.invoice'
    _name = 'account.invoice'
    state=fields.Selection(selection_add=[('proforma2','提交')])

    @api.multi
    def action_submit_supplier(self):
        self.write({
            'is_submit': True
        })

        res=super(AccountSubmit,self)
        # to_open_invoices=self.filtered(lambda inv:inv.state !='open')
        for button in self:
            print button
            for a in button:
                a.state = 'proforma2'
            return




    @api.multi
    def action_submit(self):
        self.action_invoice_proforma2()
        self.write({
            'is_submit': True
        })


